package backstage.app.respont;

import com.fasterxml.jackson.annotation.JsonFormat;

import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/***
 * 统一返回数据封装类
 * @author wangweiquan
 *
 * @param <T>
 */
@Data
@SuppressWarnings("all")
public class RespontDateJson<T> implements Serializable {

    private int code;

    private T data;

    private long count;

    private String msg;
 

    public   RespontDateJson(int code, T data, long count, String msg) {
        this.code = code;
        this.data = data;
        this.count = count;
        this.msg = msg;
         
    }
    public   RespontDateJson(int code, T data,  String msg) {
        this.code = code;
        this.data = data;
        
        this.msg = msg;
         
    }
    public <T>  RespontDateJson() { }

    public static  <T>RespontDateJson<T> ok(T date, long total, String message){

        return new RespontDateJson(0,date,total,message) ;
    }
    public static  <T>RespontDateJson<T> ok(T date, String message){

        return new RespontDateJson(0,date,message) ;
    }
    public static  <T>RespontDateJson<T> fuall(T date,  String message){

        return new RespontDateJson(500,date,message) ;
    }
     
	 
}
